package com.jiyun.controller;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jiyun.result.Result;
import com.jiyun.service.ITransportService;
import com.jiyun.statistical.pojo.Transport;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-02-12
 */
@RestController
@RequestMapping("/transport")
public class TransportController {
    @Autowired
    private ITransportService transportService;

    @Operation(summary = "查询所有异常统计")
    @GetMapping("/findTransportAll/{pageNum}/{pageSize}")
    public Result findTransportAll(@PathVariable Integer pageNum, @PathVariable Integer pageSize) {
        // 使用 PageHelper 进行分页查询
        PageHelper.startPage(pageNum, pageSize);
        List<Transport> Transport = transportService.list();
        PageInfo<Transport> pageInfo = new PageInfo<>(Transport);
        return Result.ok(pageInfo);
    }


}
